Skip to content

Conversation

Eason20000
Copy link

Fixed issue:
#1102

@Lassulus
Copy link
Collaborator

ah the set -x is used to enable debug output (and set +x disables it again), we probably need to call exit 1 if the passwords don't match, not sure why it is working if we rearrange the debug outputs

@Eason20000
Copy link
Author

Maybe it's because until catches the last command's exit code in the function? And set -x is the last so it is always 0 and no matter what [ $password = $password_check ]'s exit code is...?

@Eason20000
Copy link
Author

Also, is it possible to automatically test the function of checking if the password is identical? I know little programming so I don't know how to do it...

@@ -143,19 +143,21 @@ in

askPassword() {
if [ -z ''${IN_DISKO_TEST+x} ]; then
set +x
promptSecret "Enter password for ${config.device}: " password
promptSecret "Enter password for ${config.device} again to be safe: " password_check
export password
[ "$password" = "$password_check" ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably better to use exit 1 if the password don't match instead of setting the debug flags

@Lassulus
Copy link
Collaborator

should be fixed by #1105

@Lassulus Lassulus closed this Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants